<template>
  <el-form-item prop="imgcode">
    <el-input class="imgcode-input" placeholder="輸入圖片驗證碼" v-model="form.imgcode" auto-complete="off">
      <template slot="append">
        <img class="vercode-img" @click="handleClick" :src="imgBase" alt="imgcode">
      </template>
    </el-input>
  </el-form-item>
</template>

<script>
export default {
  name: 'imgcode',
  props: {
    form: {
      type: Object
    },
    imgBase: {
      type: String
    }
  },
  methods: {
    handleClick () {
      this.$emit('handleImgcode')
    }
  }
}
</script>

<style lang="stylus" rel="stylesheet/stylus">
.imgcode-input{
  box-sizing: border-box;
  padding-right: 40px;
  background:rgba(255,255,255,0.3);
  border-radius: 42px;
  .el-input__inner{
    height: 91px;
    line-height: 91px;
    padding: 0 26px;
    background:rgba(255,255,255,0);
    border-top-left-radius: 46px;
    border-bottom-left-radius: 46px;
    border: none;
    outline: none;
    font-size: 36px;
    color:rgba(206, 166, 207, 1);
  }
  .el-input-group__append{
    box-sizing: border-box;
    width: 170px;
    padding-top: 8px;
    padding: 0;
    margin-right: 40px;
    background:rgba(255,255,255,0);
    border: none;
    .vercode-img{
      display: block;
      width: 100%;
      height: 75px;
    }
  }
}
</style>
